class Solution:
    def mul(self, a, b):
        def helper(a, b):
            if b == 0:
                return 0
            tmp = helper(a, b // 2)
            if b & 1 == 1:
                res = tmp + tmp + a
            else:
                res = tmp + tmp
            return res

        if a >= b:
            return helper(a, b)
        else:
            return helper(b, a)


solution = Solution()
res = solution.mul(3, 1)
print(res)
